package test;

import java.util.HashSet;
import java.util.Set;

public class test1 {
    public int fun(String str1, String str2) {
        int[][] dp = new int[str1.length() + 1][str2.length() + 1];
        int max = 0;
        int pos = 0;
        for (int i = 1; i <= str1.length(); i++) {
            for (int j = 1; j <= str2.length(); j++) {
                if (str1.charAt(i - 1) == str2.charAt(i - 1)) {
                    dp[i][j] = dp[i - 1][j - 1] + 1;
                } else {
                    dp[i][j] = 0;

                }
                if (dp[i][j] > max) {
                    max = dp[i][j];
                    pos = i - 1;

                }

            }

        }
        return max;

    }

    public static void main(String[] args) {
        String bb = new String("ab");
        String aa = "ab";
        System.out.println(aa == bb);


    }

    static void fun2(int n){
        int[] ah = new int[n];
    }
}
